WPS Office.apk(点击下载) / aadw.java


package defpackage;

import com.mopub.nativeads.MoPubNativeAdPositioning;
import java.io.IOException;
import java.io.PrintStream;

/* renamed from: aadw  reason: default package */
public final class aadw implements aadv {
    static final long[] BSM = {0, 0, -1, -1};
    static final int[] BSN = new int[0];
    public static final String[] BSO = {"", "\r", "\n", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, ".", null, null};
    public static final String[] BSP = {"DEFAULT", "INCOMMENT", "NESTED_COMMENT", "INQUOTEDSTRING"};
    public static final int[] BSQ = {-1, -1, -1, -1, 1, 0, -1, 2, -1, -1, -1, -1, -1, 3, -1, -1, 0, -1, -1, -1, -1};
    static final long[] BSR = {458759};
    static final long[] BSS = {40};
    static final long[] BST = {8};
    static final long[] BSU = {65488};
    int BSK;
    public PrintStream BSL;
    private final int[] BSW;
    private final int[] BSX;
    StringBuffer BSY;
    int BSZ;
    int BTa;
    protected char BTb;
    int BTc;
    int BTd;
    int BTe;
    int BTf;
    int BTg;
    int BTh;
    protected aady BUh;

    public aadw(aady aady) {
        this.BSL = System.out;
        this.BSW = new int[3];
        this.BSX = new int[6];
        this.BTc = 0;
        this.BTd = 0;
        this.BUh = aady;
    }

    public aadw(aady aady, int i) {
        this(aady);
        axq(i);
    }

    private final void axp(int i) {
        if (this.BSW[i] != this.BTf) {
            int[] iArr = this.BSX;
            int i2 = this.BTe;
            this.BTe = i2 + 1;
            iArr[i2] = i;
            this.BSW[i] = this.BTf;
        }
    }

    private void axq(int i) {
        if (i >= 4 || i < 0) {
            throw new aaea("Error: Ignoring invalid lexical state : " + i + ". State unchanged.", 2);
        }
        this.BTc = i;
    }

    private final int cp(int i, int i2, int i3) {
        this.BTh = i2;
        this.BTg = 0;
        try {
            this.BTb = this.BUh.readChar();
            return nv(0, 1);
        } catch (IOException e) {
            return 1;
        }
    }

    private final void gUB() {
        this.BTf = -2147483647;
        int i = 3;
        while (true) {
            int i2 = i - 1;
            if (i > 0) {
                this.BSW[i2] = Integer.MIN_VALUE;
                i = i2;
            } else {
                return;
            }
        }
    }

    private aadz gUP() {
        int i = this.BTh;
        aadz aadz = new aadz();
        aadz.BTv = this.BTh;
        String str = BSO[this.BTh];
        if (str == null) {
            str = this.BUh.gUI();
        }
        aadz.image = str;
        aadz.BTw = this.BUh.gUH();
        aadz.BTx = this.BUh.gUG();
        aadz.BTy = this.BUh.gUF();
        aadz.BTz = this.BUh.gUE();
        return aadz;
    }

    private final int nu(int i, int i2) {
        this.BTh = i2;
        this.BTg = 0;
        return 1;
    }

    private final int nv(int i, int i2) {
        int i3 = 0;
        this.BTe = 2;
        int i4 = 1;
        this.BSX[0] = i;
        int i5 = MoPubNativeAdPositioning.MoPubClientPositioning.NO_REPEAT;
        while (true) {
            int i6 = this.BTf + 1;
            this.BTf = i6;
            if (i6 == Integer.MAX_VALUE) {
                gUB();
            }
            if (this.BTb < '@') {
                long j = 1 << this.BTb;
                do {
                    i4--;
                    switch (this.BSX[i4]) {
                        case 0:
                            if ((4294977024L & j) != 0) {
                                i5 = 3;
                                axp(0);
                                continue;
                            } else {
                                continue;
                            }
                        case 1:
                            if ((287948901175001088L & j) != 0) {
                                i5 = 17;
                                axp(1);
                                continue;
                            } else {
                                continue;
                            }
                        case 2:
                            if ((287948901175001088L & j) != 0) {
                                if (i5 > 17) {
                                    i5 = 17;
                                }
                                axp(1);
                                continue;
                            } else if ((4294977024L & j) == 0) {
                                continue;
                            } else {
                                if (i5 > 3) {
                                    i5 = 3;
                                }
                                axp(0);
                                continue;
                            }
                    }
                } while (i4 != i3);
            }
            if (i5 != Integer.MAX_VALUE) {
                this.BTh = i5;
                this.BTg = i2;
                i5 = MoPubNativeAdPositioning.MoPubClientPositioning.NO_REPEAT;
            }
            i2++;
            i4 = this.BTe;
            this.BTe = i3;
            i3 = 2 - i3;
            if (i4 != i3) {
                try {
                    this.BTb = this.BUh.readChar();
                } catch (IOException e) {
                }
            }
            return i2;
        }
    }

    private final int nw(int i, int i2) {
        int i3 = 0;
        this.BTe = 3;
        int i4 = 1;
        this.BSX[0] = 0;
        int i5 = MoPubNativeAdPositioning.MoPubClientPositioning.NO_REPEAT;
        while (true) {
            int i6 = this.BTf + 1;
            this.BTf = i6;
            if (i6 == Integer.MAX_VALUE) {
                gUB();
            }
            if (this.BTb < '@') {
                do {
                    i4--;
                    switch (this.BSX[i4]) {
                        case 0:
                            if (i5 > 8) {
                                i5 = 8;
                                continue;
                            } else {
                                continue;
                            }
                        case 1:
                            if (i5 > 6) {
                                i5 = 6;
                                continue;
                            } else {
                                continue;
                            }
                    }
                } while (i4 != i3);
            } else if (this.BTb < 128) {
                do {
                    i4--;
                    switch (this.BSX[i4]) {
                        case 0:
                            if (i5 > 8) {
                                i5 = 8;
                            }
                            if (this.BTb == '\\') {
                                int[] iArr = this.BSX;
                                int i7 = this.BTe;
                                this.BTe = i7 + 1;
                                iArr[i7] = 1;
                                continue;
                            } else {
                                continue;
                            }
                        case 1:
                            if (i5 > 6) {
                                i5 = 6;
                                continue;
                            } else {
                                continue;
                            }
                        case 2:
                            if (i5 > 8) {
                                i5 = 8;
                                continue;
                            } else {
                                continue;
                            }
                    }
                } while (i4 != i3);
            } else {
                int i8 = (this.BTb & 255) >> 6;
                long j = 1 << (this.BTb & '?');
                do {
                    i4--;
                    switch (this.BSX[i4]) {
                        case 0:
                            if ((BSM[i8] & j) != 0 && i5 > 8) {
                                i5 = 8;
                                continue;
                            }
                        case 1:
                            if ((BSM[i8] & j) != 0 && i5 > 6) {
                                i5 = 6;
                                continue;
                            }
                    }
                } while (i4 != i3);
            }
            if (i5 != Integer.MAX_VALUE) {
                this.BTh = i5;
                this.BTg = i2;
                i5 = MoPubNativeAdPositioning.MoPubClientPositioning.NO_REPEAT;
            }
            i2++;
            i4 = this.BTe;
            this.BTe = i3;
            i3 = 3 - i3;
            if (i4 != i3) {
                try {
                    this.BTb = this.BUh.readChar();
                } catch (IOException e) {
                }
            }
            return i2;
        }
    }

    private final int nx(int i, int i2) {
        int i3 = 0;
        this.BTe = 3;
        int i4 = 1;
        this.BSX[0] = 0;
        int i5 = MoPubNativeAdPositioning.MoPubClientPositioning.NO_REPEAT;
        while (true) {
            int i6 = this.BTf + 1;
            this.BTf = i6;
            if (i6 == Integer.MAX_VALUE) {
                gUB();
            }
            if (this.BTb < '@') {
                long j = 1 << this.BTb;
                do {
                    i4--;
                    switch (this.BSX[i4]) {
                        case 0:
                        case 2:
                            if ((-17179869185L & j) == 0) {
                                continue;
                            } else {
                                if (i5 > 15) {
                                    i5 = 15;
                                }
                                axp(2);
                                continue;
                            }
                        case 1:
                            if (i5 > 14) {
                                i5 = 14;
                                continue;
                            } else {
                                continue;
                            }
                    }
                } while (i4 != i3);
            } else if (this.BTb < 128) {
                long j2 = 1 << (this.BTb & '?');
                do {
                    i4--;
                    switch (this.BSX[i4]) {
                        case 0:
                            if ((-268435457 & j2) != 0) {
                                if (i5 > 15) {
                                    i5 = 15;
                                }
                                axp(2);
                                continue;
                            } else if (this.BTb == '\\') {
                                int[] iArr = this.BSX;
                                int i7 = this.BTe;
                                this.BTe = i7 + 1;
                                iArr[i7] = 1;
                                continue;
                            } else {
                                continue;
                            }
                        case 1:
                            if (i5 > 14) {
                                i5 = 14;
                                continue;
                            } else {
                                continue;
                            }
                        case 2:
                            if ((-268435457 & j2) == 0) {
                                continue;
                            } else {
                                if (i5 > 15) {
                                    i5 = 15;
                                }
                                axp(2);
                                continue;
                            }
                    }
                } while (i4 != i3);
            } else {
                int i8 = (this.BTb & 255) >> 6;
                long j3 = 1 << (this.BTb & '?');
                do {
                    i4--;
                    switch (this.BSX[i4]) {
                        case 0:
                        case 2:
                            if ((BSM[i8] & j3) == 0) {
                                continue;
                            } else {
                                if (i5 > 15) {
                                    i5 = 15;
                                }
                                axp(2);
                                continue;
                            }
                        case 1:
                            if ((BSM[i8] & j3) != 0 && i5 > 14) {
                                i5 = 14;
                                continue;
                            }
                    }
                } while (i4 != i3);
            }
            if (i5 != Integer.MAX_VALUE) {
                this.BTh = i5;
                this.BTg = i2;
                i5 = MoPubNativeAdPositioning.MoPubClientPositioning.NO_REPEAT;
            }
            i2++;
            i4 = this.BTe;
            this.BTe = i3;
            i3 = 3 - i3;
            if (i4 != i3) {
                try {
                    this.BTb = this.BUh.readChar();
                } catch (IOException e) {
                }
            }
            return i2;
        }
    }

    private final int ny(int i, int i2) {
        int i3 = 0;
        this.BTe = 3;
        int i4 = 1;
        this.BSX[0] = 0;
        int i5 = MoPubNativeAdPositioning.MoPubClientPositioning.NO_REPEAT;
        while (true) {
            int i6 = this.BTf + 1;
            this.BTf = i6;
            if (i6 == Integer.MAX_VALUE) {
                gUB();
            }
            if (this.BTb < '@') {
                do {
                    i4--;
                    switch (this.BSX[i4]) {
                        case 0:
                            if (i5 > 12) {
                                i5 = 12;
                                continue;
                            } else {
                                continue;
                            }
                        case 1:
                            if (i5 > 9) {
                                i5 = 9;
                                continue;
                            } else {
                                continue;
                            }
                    }
                } while (i4 != i3);
            } else if (this.BTb < 128) {
                do {
                    i4--;
                    switch (this.BSX[i4]) {
                        case 0:
                            if (i5 > 12) {
                                i5 = 12;
                            }
                            if (this.BTb == '\\') {
                                int[] iArr = this.BSX;
                                int i7 = this.BTe;
                                this.BTe = i7 + 1;
                                iArr[i7] = 1;
                                continue;
                            } else {
                                continue;
                            }
                        case 1:
                            if (i5 > 9) {
                                i5 = 9;
                                continue;
                            } else {
                                continue;
                            }
                        case 2:
                            if (i5 > 12) {
                                i5 = 12;
                                continue;
                            } else {
                                continue;
                            }
                    }
                } while (i4 != i3);
            } else {
                int i8 = (this.BTb & 255) >> 6;
                long j = 1 << (this.BTb & '?');
                do {
                    i4--;
                    switch (this.BSX[i4]) {
                        case 0:
                            if ((BSM[i8] & j) != 0 && i5 > 12) {
                                i5 = 12;
                                continue;
                            }
                        case 1:
                            if ((BSM[i8] & j) != 0 && i5 > 9) {
                                i5 = 9;
                                continue;
                            }
                    }
                } while (i4 != i3);
            }
            if (i5 != Integer.MAX_VALUE) {
                this.BTh = i5;
                this.BTg = i2;
                i5 = MoPubNativeAdPositioning.MoPubClientPositioning.NO_REPEAT;
            }
            i2++;
            i4 = this.BTe;
            this.BTe = i3;
            i3 = 3 - i3;
            if (i4 != i3) {
                try {
                    this.BTb = this.BUh.readChar();
                } catch (IOException e) {
                }
            }
            return i2;
        }
    }

    public final aadz gUQ() {
        int nu;
        int i;
        int nu2;
        int nu3;
        int nu4;
        boolean z;
        aadz aadz;
        String str = null;
        int i2 = 0;
        aadz aadz2 = null;
        while (true) {
            try {
                aady aady = this.BUh;
                aady.BTm = -1;
                char readChar = aady.readChar();
                aady.BTm = aady.BTn;
                this.BTb = readChar;
                this.BSY = null;
                this.BSZ = 0;
                while (true) {
                    switch (this.BTc) {
                        case 0:
                            this.BTh = MoPubNativeAdPositioning.MoPubClientPositioning.NO_REPEAT;
                            this.BTg = 0;
                            switch (this.BTb) {
                                case '\n':
                                    nu4 = cp(0, 2, 0);
                                    break;
                                case '\r':
                                    nu4 = cp(0, 1, 0);
                                    break;
                                case '\"':
                                    nu4 = nu(0, 13);
                                    break;
                                case '(':
                                    nu4 = nu(0, 4);
                                    break;
                                case '.':
                                    nu4 = nu(0, 18);
                                    break;
                                default:
                                    nu4 = nv(2, 0);
                                    break;
                            }
                            i = nu4;
                            break;
                        case 1:
                            this.BTh = MoPubNativeAdPositioning.MoPubClientPositioning.NO_REPEAT;
                            this.BTg = 0;
                            switch (this.BTb) {
                                case '(':
                                    nu3 = nu(0, 7);
                                    break;
                                case ')':
                                    nu3 = nu(0, 5);
                                    break;
                                default:
                                    nu3 = nw(0, 0);
                                    break;
                            }
                            i = nu3;
                            break;
                        case 2:
                            this.BTh = MoPubNativeAdPositioning.MoPubClientPositioning.NO_REPEAT;
                            this.BTg = 0;
                            switch (this.BTb) {
                                case '(':
                                    nu2 = nu(0, 10);
                                    break;
                                case ')':
                                    nu2 = nu(0, 11);
                                    break;
                                default:
                                    nu2 = ny(0, 0);
                                    break;
                            }
                            i = nu2;
                            break;
                        case 3:
                            this.BTh = MoPubNativeAdPositioning.MoPubClientPositioning.NO_REPEAT;
                            this.BTg = 0;
                            switch (this.BTb) {
                                case '\"':
                                    nu = nu(0, 16);
                                    break;
                                default:
                                    nu = nx(0, 0);
                                    break;
                            }
                            i = nu;
                            break;
                        default:
                            i = i2;
                            break;
                    }
                    if (this.BTh != Integer.MAX_VALUE) {
                        if (this.BTg + 1 < i) {
                            this.BUh.axr((i - this.BTg) - 1);
                        }
                        if ((BSR[this.BTh >> 6] & (1 << (this.BTh & 63))) != 0) {
                            aadz gUP = gUP();
                            gUP.BUk = aadz2;
                            switch (this.BTh) {
                                case 16:
                                    if (this.BSY == null) {
                                        this.BSY = new StringBuffer();
                                    }
                                    StringBuffer stringBuffer = this.BSY;
                                    aady aady2 = this.BUh;
                                    int i3 = this.BSZ;
                                    int i4 = this.BTg + 1;
                                    this.BTa = i4;
                                    stringBuffer.append(aady2.axs(i3 + i4));
                                    gUP.image = this.BSY.substring(0, this.BSY.length() - 1);
                                    break;
                            }
                            if (BSQ[this.BTh] == -1) {
                                return gUP;
                            }
                            this.BTc = BSQ[this.BTh];
                            return gUP;
                        } else if ((BSS[this.BTh >> 6] & (1 << (this.BTh & 63))) != 0) {
                            if ((BST[this.BTh >> 6] & (1 << (this.BTh & 63))) != 0) {
                                aadz = gUP();
                                if (aadz2 != null) {
                                    aadz.BUk = aadz2;
                                    aadz2.BUj = aadz;
                                }
                            } else {
                                aadz = aadz2;
                            }
                            if (BSQ[this.BTh] != -1) {
                                this.BTc = BSQ[this.BTh];
                                aadz2 = aadz;
                                i2 = i;
                            } else {
                                aadz2 = aadz;
                                i2 = i;
                            }
                        } else {
                            int i5 = this.BSZ;
                            int i6 = this.BTg + 1;
                            this.BTa = i6;
                            this.BSZ = i5 + i6;
                            switch (this.BTh) {
                                case 6:
                                    if (this.BSY == null) {
                                        this.BSY = new StringBuffer();
                                    }
                                    this.BSY.append(this.BUh.axs(this.BSZ));
                                    this.BSZ = 0;
                                    this.BSY.deleteCharAt(this.BSY.length() - 2);
                                    break;
                                case 7:
                                    if (this.BSY == null) {
                                        this.BSY = new StringBuffer();
                                    }
                                    this.BSY.append(this.BUh.axs(this.BSZ));
                                    this.BSZ = 0;
                                    this.BSK = 1;
                                    break;
                                case 9:
                                    if (this.BSY == null) {
                                        this.BSY = new StringBuffer();
                                    }
                                    this.BSY.append(this.BUh.axs(this.BSZ));
                                    this.BSZ = 0;
                                    this.BSY.deleteCharAt(this.BSY.length() - 2);
                                    break;
                                case 10:
                                    if (this.BSY == null) {
                                        this.BSY = new StringBuffer();
                                    }
                                    this.BSY.append(this.BUh.axs(this.BSZ));
                                    this.BSZ = 0;
                                    this.BSK++;
                                    break;
                                case 11:
                                    if (this.BSY == null) {
                                        this.BSY = new StringBuffer();
                                    }
                                    this.BSY.append(this.BUh.axs(this.BSZ));
                                    this.BSZ = 0;
                                    this.BSK--;
                                    if (this.BSK == 0) {
                                        axq(1);
                                        break;
                                    }
                                    break;
                                case 13:
                                    if (this.BSY == null) {
                                        this.BSY = new StringBuffer();
                                    }
                                    this.BSY.append(this.BUh.axs(this.BSZ));
                                    this.BSZ = 0;
                                    this.BSY.deleteCharAt(this.BSY.length() - 1);
                                    break;
                                case 14:
                                    if (this.BSY == null) {
                                        this.BSY = new StringBuffer();
                                    }
                                    this.BSY.append(this.BUh.axs(this.BSZ));
                                    this.BSZ = 0;
                                    this.BSY.deleteCharAt(this.BSY.length() - 2);
                                    break;
                            }
                            if (BSQ[this.BTh] != -1) {
                                this.BTc = BSQ[this.BTh];
                            }
                            this.BTh = MoPubNativeAdPositioning.MoPubClientPositioning.NO_REPEAT;
                            try {
                                this.BTb = this.BUh.readChar();
                                i2 = 0;
                            } catch (IOException e) {
                                i = 0;
                            }
                        }
                    }
                }
            } catch (IOException e2) {
                this.BTh = 0;
                aadz gUP2 = gUP();
                gUP2.BUk = aadz2;
                return gUP2;
            }
        }
        int gUF = this.BUh.gUF();
        int gUE = this.BUh.gUE();
        try {
            this.BUh.readChar();
            this.BUh.axr(1);
            z = false;
        } catch (IOException e3) {
            String gUI = i <= 1 ? "" : this.BUh.gUI();
            if (this.BTb == '\n' || this.BTb == '\r') {
                gUF++;
                z = true;
                str = gUI;
                gUE = 0;
            } else {
                gUE++;
                z = true;
                str = gUI;
            }
        }
        if (!z) {
            this.BUh.axr(1);
            str = i <= 1 ? "" : this.BUh.gUI();
        }
        throw new aaea(z, this.BTc, gUF, gUE, str, this.BTb, 0);
    }
}